<?php
	if (!defined('BASEPATH')) {
		exit('No direct script access allowed');
	}

	if (!function_exists('kepala_keluarga')) {
		function kepala_keluarga($kd_kk = '') {
			$CI = & get_instance();
      $CI->load->database();

      $sql = 'SELECT nama FROM penduduk WHERE kd_kk = '.$kd_kk.' AND id_shdk = "1"';
      $query = $CI->db->query($sql);

      if ($query->num_rows() > 0) {
          $result = $query->row_array();            
          $query->free_result();
      } else {
          $result = array();
      }
      if(isset($result['nama'])){
      	echo $result['nama'];
      }
		}
	}
?>